package com.loong.coupon.model;

import com.loong.common.mybatis.entity.BaseEntity;
import javax.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.Date;

/**
 * 用户和优惠券关联
 */
@Builder
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "user_coupon")
public class UserCoupon extends BaseEntity {
    /**
     * 用户id
     */
    @Column(name = "user_id")
    private Long userId;

    /**
     * 优惠券id
     */
    @Column(name = "coupon_id")
    private Long couponId;

    /**
     * code
     */
    private Integer code;

    /**
     * 优惠券使用状态
     */
    @Column(name = "coupon_use_status")
    private Integer couponUseStatus;

    /**
     * 优惠券数量
     */
    @Column(name = "coupon_num")
    private Integer couponNum;

    /**
     * 有效起始时间
     */
    @Column(name = "start_time")
    private Date startTime;

    /**
     * 有效结束时间
     */
    @Column(name = "end_time")
    private Date endTime;
}